#ifndef __APPLICATION_H__
#define __APPLICATION_H__

class SubMenu;

#include <conio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <Windows.h>
#include "SubMenu.h"
#include "ShapeContainer.h"

static const int ESC = 27;

using namespace std;

class Application
{
	ShapeContainer* m_shapeCon;
	unsigned int m_defaultDraw;
	MyScreen m_scrCur, m_scrNew;
	MyScreen * m_ptrScrCur, * m_ptrScrNew;

public:
	Application(ShapeContainer* newShape):m_shapeCon (newShape), m_defaultDraw(0){}

	unsigned int getDefaultDraw() const {return m_defaultDraw;}
	void changeDefaultDraw (){m_defaultDraw = 1 - m_defaultDraw;}
	bool addRectangle ();
	bool addCircle ();
	void drawShapeCon ()  ;
	void select () ;
	bool delShape ( unsigned int index);
	bool moveShapeToBack ( unsigned int index){return m_shapeCon->moveShapeToBack(index);}
	bool moveShapeToFront ( unsigned int index){return m_shapeCon->moveShapeToFront(index);}
	bool moveShape ( unsigned int index);
	void input();
	bool addAnimationToShape ( unsigned int index);
	void printAnimWithSplit();
	void printAnimWithCollision();
	bool saveTextFile(string & fileName) ;
	bool saveBinFile(string & fileName) ;
	bool loadTextFile(string & fileName) ;
	bool loadBinFile(string & fileName) ;
};

#endif

